//
// Created by 123 on 2024/12/26.
//

#include <stdio.h>
#include <string.h>
//定义结构体
struct Student{
    char name[50];
    int age;
    float score;
};

int main062(){
    //声明初始化结构体变量
    struct Student s1;
    strcpy(s1.name,"jack");
    s1.age = 18;
    s1.score = 98.5;
    //输出结构体
    printf("name:%s\n",s1.name);
    printf("age:%d\n",s1.age);
    printf("score:%.2f\n",s1.score);

    struct Student s2 = {"tom",19,60.2};
    printf("name:%s\n",s2.name);
    printf("age:%d\n",s2.age);
    printf("score:%.2f\n",s2.score);

    struct Student s3 = {"jerry",18};
    printf("name:%s\n",s3.name);
    printf("age:%d\n",s3.age);
    printf("score:%.2f\n",s3.score);
    return 0;
}
